--!native

_IsStudio = Debugger.IsStudio;

local m = {}

--- Fisher-Yates shuffle a array (must be array!)
function m.Shuffle(array, createNew)
	createNew = createNew or false;

	local tbl = array;

	if createNew then 
		tbl = {}
		for i = 1, #array do
			tbl[i] = array[i]
		end
	end

	for i = #tbl, 2, -1 do
		local j = math.random(i)
		tbl[i], tbl[j] = tbl[j], tbl[i]
	end
	return tbl
end

return m;